﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Micronet.OpenWeb.Utils;

namespace Micronet.OpenWeb.OpenWeb.Admin.Views.Shared.OpenPersonality
{
    public partial class TalentTypesEdit : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            if ("ID".OwQsIsExist())
            {
                TalentTypeDv.DefaultMode = DetailsViewMode.Edit;
            }
            else
            {
                TalentTypeDv.DefaultMode = DetailsViewMode.Insert;

            }

            TalentTypeOds.Inserted += new ObjectDataSourceStatusEventHandler(TalentTypeOds_Inserted);
            TalentTypeOds.Updated += new ObjectDataSourceStatusEventHandler(TalentTypeOds_Updated);
            TalentTypeOds.Deleted += new ObjectDataSourceStatusEventHandler(TalentTypeOds_Deleted);
        }

        void TalentTypeOds_Deleted(object sender, ObjectDataSourceStatusEventArgs e)
        {
            Response.Redirect("TalentTypesAdmin.aspx");
        }

        void TalentTypeOds_Updated(object sender, ObjectDataSourceStatusEventArgs e)
        {
            Response.Redirect("TalentTypesAdmin.aspx");

        }

        void TalentTypeOds_Inserted(object sender, ObjectDataSourceStatusEventArgs e)
        {
            Response.Redirect("TalentTypesAdmin.aspx");

        }
    }
}